using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.ComponentModel;

namespace mdv.wssSchemaExplorer.WSS
{
    public class wssMetadata
    {
        public wssMetadata()
        {
        }
        public wssMetadata(XmlNode node)
            : this()
        {
            if (node.HasChildNodes)
                foreach (XmlNode xn in node.ChildNodes)
                {
                    if (xn.Name == "ContentTypes")
                        _contentTypes = new wssContentTypes(xn);
                    if (xn.Name == "Fields")
                        _fields = new wssFields(xn);
                    if (xn.Name == "Views")
                        _views = new wssViews(xn);
                    if (xn.Name == "Forms")
                        _forms = new wssForms(xn);
                }
        }
        #region Non-Designer Properties
        private wssContentTypes _contentTypes;
        [Browsable(false)]
        public wssContentTypes ContentTypes
        {
            get { return _contentTypes; }
        }
        private wssFields _fields;
        [Browsable(false)]
        public wssFields Fields
        {
            get { return _fields; }
        }
        private wssForms _forms;
        [Browsable(false)]
        public wssForms Forms
        {
            get { return _forms; }
        }
        private wssViews _views;
        [Browsable(false)]
        public wssViews Views
        {
            get { return _views; }
        }
        #endregion
        public override string ToString()
        {
            return "Metadata";
        }
    }
}